#include <iostream>
#include <string>
#include <stdexcept>
using namespace std;

int main(int argc, char const *argv[])
{
    // 检查命令行参数数量
    if (argc != 3)
    {
        cerr << "Usage: " << argv[0] << " <integer1> <integer2>" << endl;
        return 1;
    }

    try
    {
        // 将命令行参数转换为整数
        int num1 = stoi(argv[1]);
        int num2 = stoi(argv[2]);

        // 计算两个整数的和
        int sum = num1 + num2;

        // 输出结果
        cout << "The sum of " << num1 << " and " << num2 << " is " << sum << endl;
    }
    catch (const invalid_argument &e)
    {
        cerr << "Error: Invalid integer argument" << endl;
        return 1;
    }
    catch (const out_of_range &e)
    {
        cerr << "Error: Integer out of range" << endl;
        return 1;
    }

    return 0;
}